-
Notifications
You must be signed in to change notification settings - Fork 6
Process logs before sending them to loki #1243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process logs before sending them to loki #1243
Conversation
* move services around (cleanup) * add first services * add more prometheus configs * add all instrumented simcore services to grafana dashboard * add newline in grafana dashboard json * minor improvement to simcore service grafana dashboard * end with empty lineto please gh * several other minor changes * another minor fix * ensure newline * remove TRACING_OPENTELEMETRY_COLLECTOR_SAMPLING_PERCENTAGE and add TRACING_SAMPLING_PROBABILITY * fix files which don't match itis/main * TRACING_SAMPLING_PROBABILITY -> TRACING_OPENTELEMETRY_SAMPLING_PROBABILITY --------- Co-authored-by: Dustin Kaiser <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
| .log_level = parsed_fields.log_level | ||
| .log_timestamp = parsed_fields.log_timestamp | ||
| .log_source = parsed_fields.log_source | ||
| .log_uid = parsed_fields.log_uid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this becomes a label in Loki?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not labels, because labels should have low cardinality (https://grafana.com/docs/loki/latest/get-started/labels/bp-labels/). Instead this adds them as keys in the log json. Then there is a json parser directly in loki and after applying that one can filter on these fields.
| if exists(.message) { | ||
| parsed_fields, err = parse_regex(.message, r'log_level=(?P<log_level>[^|]*) \| log_timestamp=(?P<log_timestamp>[^|]*) \| log_source=(?P<log_source>[^|]*) \| log_uid=(?P<log_uid>[^|]*) \| log_oec=(?P<log_oec>[^|]*) \| log_trace_id=(?P<log_trace_id>[^|]*) \| log_span_id=(?P<log_span_id>[^|]*) \| log_msg=(?P<log_msg>.*)$') | ||
| if err == null { | ||
| .log_level = parsed_fields.log_level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this won't parse traefik logs.
We did fix this in Graylog #293
Might be interesting if you want to include traefik log level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bisgaard-itis please consider YH's comments, or at least the traefik one. Thanks a lot, merge at your own discretion please
What do these changes do?
Related issue/s
Related PR/s
Checklist